package org.zsl.mybatis.app;

import org.apache.ibatis.session.SqlSession;
import org.zsl.mybatis.mapper.UserMapper;
import org.zsl.mybatis.model.User;
import org.zsl.mybatis.util.SqlSessionFactory;

import java.io.IOException;
import java.util.List;

public class Client6 {

    public static void main(String[] args) throws IOException {

         SqlSession session = SqlSessionFactory.getSqlSession();

          UserMapper mapper=    session.getMapper(UserMapper.class);
           List<User> users= mapper.selectAll();

        for (User user:users) {
            System.out.println(user);
        }

        session.close();
    }
}
